<?php
    require_once("header.php");	
	require_once $_site->get_handlepath('device');
		
	$data['pid']=request('pid',false,true,false,0);
	$data['state']=request('state',false,true,false,1);
	$data['address']=request('address',true,false,false,0);//作业点id
	$data['no']=request('no',true,false,false,0);
	$data['type']=$type=request('type',true,false,false,1);
	$data['truck']=$truck=request('truck',true,false,false,0);
	$data['dust']=$dust=request('dust',true,false,false,0);
	$data['onload']=$onload=request('onload',true,false,false,0);
	$data['dname']=$dname=request('dname');
	$data['start_time']=request('start_time');
	$data['end_time']=request('end_time');
		
	$result = device_fun_get_checkin_search($data,"count(*) AS sum");
	$sum=0;
	if($result && $result[0]['sum'])$sum=$result[0]['sum'];	
?>
<script type="text/javascript" charset="utf-8">
	loader.file({
		plugin:['validform/main','dialog/main','my97/wdatepicker'],
		skincss:['list']
	})
	
	function agree(){
		$.post("/handle.php",$("#form1").serialize(),function(res){
			if(res.state){					
				parent.change(res.info);
				return;
			}
			alert(res.msg);
			},'json');            
	}

	function getfile(){
       var imgout=$("input[name='imgout']:checked");
       if(!confirm("确认操作 : "+imgout.attr("title")+" ?"))return false;

       var ajax_url="/handle.php?h=device/fileout&<?php echo http_build_query($data)?>&imgout="+imgout.val();
       $.getJSON(ajax_url,function(res){
           if(res.state)alert(res.info);
       })
    }
</script>
<style type="text/css">
	.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
</style>
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/fileout">      
	  <table cellpadding="0" cellspacing="1" border="0" class="table">

			<tr>
				<td colspan="4" style="padding: 10px;text-align: center;">
                                                              共搜到<strong><?php echo $sum?></strong>张图片
				</td>
			</tr>
			
			<tr>
			    <td>操作</td>
				<td colspan="3" style="text-align: left">
					<label><input type="radio" name="imgout" value="0" title="只导出图片" checked>只导出图片</label>&nbsp;&nbsp;
					<label><input type="radio" name="imgout" value="1" title="导出并删除图片">导出并删除图片</label>
				</td>
			</tr>
			
			<tr>
			    <td></td>			
				<td colspan="3" style="text-align: left">
					处理中 ....
				</td>
			</tr>				
			
			<tr>
				<td colspan="4" >
                      <input type="button" value="提 交" class="button1" onclick="getfile()">&nbsp;&nbsp;                      
				</td>
			</tr>
		</table>
	</form>	
	</div>
</body>
</html>